<template>
	<!--pages/my/my.wxml-->
	<view class="continer">
		<view class="bg"></view>
		<view style="z-index: 2;">
			<view style="z-index: 2;" class="avatar">
				<view class="avatar-image">
					<image :src="photo"></image>
				</view>
				<view class="avatar-text" >
					<view  class="avatar-text-u" @click="userLogin()">{{name}}</view>
					<!-- <view  class="avatar-text-e">ID：每天都是好心情~</view> -->
				</view>
			</view>
			<navigator  url="../his_order/his_order">
				<view class="item-group" @click="getOrdersInfo()">
					<view class="item-group-i">
						<image src="../../static/Fig.png"></image>
					</view>
					<view class="item-group-t">历史订单</view>
					<view class="item-group-n">
						<image src="../../static/next.png"></image>
					</view>
				</view>
			</navigator>
					
			<navigator url="../pri_price/print_pricce">
				<view class="item-group">
					<view class="item-group-i">
						<image src="../../static/lemon.png"></image>
					</view>
					<view class="item-group-t">打印价格</view>
					<view class="item-group-n">
						<image src="../../static/next.png"></image>
					</view>
				</view>
			</navigator>
					
			<navigator  url="../ContactCustomerService/ContactCustomerService">
				<view class="item-group">
					<view class="item-group-i">
						<image src="../../static/mango.png"></image>
					</view>
					<view class="item-group-t">反馈意见</view>
					<view class="item-group-n">
						<image src="../../static/next.png"> </image>
					</view>
				</view> 
			</navigator>
			
			<navigator url="../InvestmentPromotion/InvestmentPromotion">
				<view class="item-group">
					<view class="item-group-i">
						<image src="../../static/pizza.png"></image>
					</view>
					<view class="item-group-t">招商加盟</view>
					<view class="item-group-n">
						<image src="../../static/next.png"></image>
					</view>
				</view> 
			</navigator>
		</view>
	</view>
</template>
<script>
	import {getToken} from "../../apis/myCookie.js"
	import {listOrders, getOrders} from "../../apis/orders.js"
	export default {
		data() {
			return {
				name: getApp().globalData.userName || '请授权登录',
				photo: getApp().globalData.headPhoto || '../../static/bag_2.png',
				interval: null,
			}
		},
		methods: {
			getInfo() {
				this.name = getApp().globalData.userName || '请授权登录';
				this.photo = getApp().globalData.headPhoto || '../../static/bag.png';
				if(getApp().globalData.agree != 'default') {
					clearInterval(this.interval);
				}
			},
			userLogin()
			{
				getApp().globalData.user.Login().then(res=>{
					if(getToken()) {
						let  that = this;
						this.interval = setInterval( function() {
							that.getInfo();
						}, 100);
						
					}
				});
			},
			getOrdersInfo()
			{
				listOrders({status: 0}).then(res => {
					console.log(res);
				})
			}
		},


	}
</script>

<style>
.continer{
    padding: 0%;
	background-color: "#F8F8F8";
}
.bg{
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	z-index: -1;
	background-color: #f8f8f8;
}
.avatar{
    height: 200rpx;
    display: flex;
    justify-content: flex-start;
    background-image: linear-gradient(125deg,#00aaff,#2fcfff,#1c95ff,#2fcfff,#00aaff);  background-size: 400% 400%;
}
.avatar-image{
    height: 120rpx;
    width: 120rpx;
    margin: 40rpx;
	border-radius: 50%;
}
.avatar-image image{
    height: 100%;
    width: 100%;
    border-radius: 50%;
}
.avatar-text{
    height: 120rpx;
    margin: 40rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}
.avatar-text-u{
    font-size: 35rpx;
	
}
.avatar-text-e{
    font-size: 20rpx;
    color: #000000;
}

.item-group{
    background-color:#ffffff;
    height: 100rpx;
    margin: 15rpx auto 15rpx auto;
    display: flex;
    justify-content: flex-start;
    border-radius: 25rpx;
	box-shadow: #dedfd0 0 0 2rpx 2rpx;
	width: 700rpx;
}
.item-group-i{
    height: 85rpx;
    width: 85rpx;
    margin: 10rpx;
}
.item-group-i image{
    height: 100%;
    width: 100%;
    border-radius: 50%;
}
.item-group-t{
    height: 100rpx;
    width: 150rpx;
    margin: 5rpx;
    display: flex;
    justify-content: center;
    flex-direction: column;
    font-size: 30rpx;
}
.item-group-n{
    height: 60rpx;
    width: 60rpx;
    margin-top: 20rpx;
    margin-left: 350rpx;
}
.item-group-n image{
    height: 100%;
    width: 100%;
    border-radius: 50%;
}	
</style>
